﻿<UserControl x:Class="EyeOpen.Market.UI.Silverlight.Customers"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:ViewModel="clr-namespace:EyeOpen.Market.ViewModel;assembly=EyeOpen.Market.ViewModel"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <Grid
        Margin="20"
        DataContext="{Binding Path=CustomerViewModel, Source={StaticResource viewModelLocator}}">
        <StackPanel HorizontalAlignment="Left">
            <Button
                Command="{Binding LoadCustomerCollectionCommand}" 
                Content="Load customer list" 
                Height="30"
                HorizontalAlignment="Left"
                Width="110"
            />
            <data:DataGrid                
                AutoGenerateColumns="False"                
                ItemsSource="{Binding CustomerCollection}"
                Margin="0, 20, 0, 0">
                <data:DataGrid.Columns>
                    <data:DataGridTextColumn Header="Id" Binding="{Binding Id}" />
                    <data:DataGridTextColumn Header="Name" Binding="{Binding Name}" />
                    <data:DataGridTextColumn Header="Lastname" Binding="{Binding Lastname}" />
                </data:DataGrid.Columns>

            </data:DataGrid>
        </StackPanel>
    </Grid>
</UserControl>
